package org.amphiprion.gameengine;

import java.util.ArrayList;
import java.util.List;

public class Group implements IObject {
	private List<IObject> objects = new ArrayList<IObject>();

	// private IObject parent;

	public void addObject(IObject o) {
		objects.add(o);
		// o.setParent(this);
	}

	public void removeObject(IObject o) {
		objects.remove(o);
		// o.unloadTexture();
	}

	@Override
	public void draw(float[] mMVPMatrix, float[] mViewMatrix, float[] mModelMatrix, float[] mProjectionMatrix, float[] mLightPosInEyeSpace) {
		for (int i = objects.size() - 1; i >= 0; i--) {
			objects.get(i).draw(mMVPMatrix, mViewMatrix, mModelMatrix, mProjectionMatrix, mLightPosInEyeSpace);
		}
	}

	@Override
	public float getX() {
		return 0;
	}

	@Override
	public float getY() {
		return 0;
	}

	@Override
	public float getZ() {
		return 0;
	}

	@Override
	public void setX(float x) {
		// TODO Auto-generated method stub

	}

	@Override
	public void setY(float y) {
		// TODO Auto-generated method stub

	}

	@Override
	public void setZ(float z) {
		// TODO Auto-generated method stub

	}

	// @Override
	// public void unloadTexture() {
	// // TODO Auto-generated method stub
	//
	// }

	public List<IObject> getObjects() {
		return objects;
	}
}
